Skip to content

Conversation

@matthewmayer
Copy link
Contributor

@matthewmayer matthewmayer commented Nov 13, 2025

Introduces localized product-name patterns across the commerce locales for faker.commerce.productName().

Added a patterns array to each src/locales/*/commerce/product_name.ts

For en locale, for example it’s “{{commerce.productAdjective}} {{commerce.productMaterial}} {{commerce.product}}” preserving the traditional “Tasty Granite Socks”

This allows for languages where the adjectives typically follow the noun e.g. fr, or rtl languages like he, or languages without spaces like zh_CN.

I am not an expert in all languages so there might be minor mistakes in some locales but it should be better than current version. I only added one pattern per language though this gives the flexibility to add more in future if needed.

Some generations:

ar أحذية مجمد رائع
az Ergonomik Rezin Stol
da Ubranded Plastik Sæbe
el Απίστευτο Φρέσκο Τραπέζι
en Practical Plastic Pants
eo populara trikita nomŝildo
es Salchichas Pequeño de Metal
es_MX Tuna Rústico de Soft
fa سالاد تازه خوش طعم
fr Chemise Raffiné en Béton
he עוף כפרי מפלדה
hu Márka nélküli Műanyag Cipő
id_ID Celana Kayu Ramping
lv Mazs plastmasas plāksteris
nl elektrische katoenen zak
pt_BR Teclado Genérico de Concreto
pt_PT Pizza Licenciado de Fresco
ru Интеллектуальный Меховой Компьютер
sv Liten Stål Bil
tr Küçük İpek Kayseri Pastırması
ur خوبصورت کنکریٹ پتلون
uz_UZ_latin Arzon Muzlatilgan Paypoq
zh_CN 钢电子的肥皂

@matthewmayer matthewmayer requested a review from a team as a code owner November 13, 2025 16:47
@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for fakerjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e23e054
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/6932b102ecfc0a000874e356
😎 Deploy Preview https://deploy-preview-3657.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Introduces localized product-name patterns across the commerce locales.

Added a patterns array to each src/locales/*/commerce/product_name.ts

For en locale, for example it’s “{{commerce.productAdjective}} {{commerce.productMaterial}} {{commerce.product}}” preserving the traditional “Tasty Granite Socks”

This allows for languages where the adjectives typically follow the noun e.g. fr, or rtl languages like he, or languages without spaces like zh_CN.

I am not an expert in all languages so there might be minor mistakes in some locales but it should be better than current version.

Some generations:

```
ar أحذية مجمد رائع
az Ergonomik Rezin Stol
da Ubranded Plastik Sæbe
el Απίστευτο Φρέσκο Τραπέζι
en Practical Plastic Pants
eo populara trikita nomŝildo
es Salchichas Pequeño de Metal
es_MX Tuna Rústico de Soft
fa سالاد تازه خوش طعم
fr Chemise Raffiné en Béton
he עוף כפרי מפלדה
hu Márka nélküli Műanyag Cipő
id_ID Celana Kayu Ramping
lv Mazs plastmasas plāksteris
nl elektrische katoenen zak
pt_BR Teclado Genérico de Concreto
pt_PT Pizza Licenciado de Fresco
ru Интеллектуальный Меховой Компьютер
sv Liten Stål Bil
tr Küçük İpek Kayseri Pastırması
ur خوبصورت کنکریٹ پتلون
uz_UZ_latin Arzon Muzlatilgan Paypoq
zh_CN 钢电子的肥皂
```
@matthewmayer matthewmayer self-assigned this Nov 13, 2025
@matthewmayer matthewmayer added p: 1-normal Nothing urgent m: commerce Something is referring to the commerce module labels Nov 13, 2025
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (78c892b) to head (e23e054).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3657   +/-   ##
=======================================
  Coverage   99.97%   99.97%           
=======================================
  Files        2995     2995           
  Lines      236243   236313   +70     
  Branches      941      939    -2     
=======================================
+ Hits       236186   236256   +70     
  Misses         57       57           
Files with missing lines Coverage Δ
src/definitions/commerce.ts 100.00% <ø> (ø)
src/locales/ar/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/az/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/da/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/el/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/en/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/eo/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/es/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/es_MX/commerce/product_name.ts 100.00% <100.00%> (ø)
src/locales/fa/commerce/product_name.ts 100.00% <100.00%> (ø)
... and 15 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xDivisionByZerox xDivisionByZerox added the c: feature Request for new feature label Dec 4, 2025
@xDivisionByZerox xDivisionByZerox added this to the v10.x milestone Dec 4, 2025
@xDivisionByZerox xDivisionByZerox added the s: accepted Accepted feature / Confirmed bug label Dec 4, 2025
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go from my side ✅

@xDivisionByZerox xDivisionByZerox added this pull request to the merge queue Dec 7, 2025
Merged via the queue into faker-js:next with commit 1cf3991 Dec 7, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: feature Request for new feature m: commerce Something is referring to the commerce module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants